﻿using EFDAL;
using IDAL;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DALFactory
{
    /// <summary>
    /// 简单工厂或者抽象工厂
    /// </summary>
    public partial class DalFactory
    {
        public static readonly string AssemblyName;

        static DalFactory()
        {
            AssemblyName = System.Configuration.ConfigurationManager.AppSettings["AssemblyName"];
        }

        //public static IUserInfoDal GetUserInfoDal()
        //{
        //    //简单工厂
        //    //return new UserInfoDal();

        //    //抽象工厂
        //    //反射创建实例
        //    object obj = Assembly.Load(AssemblyName).CreateInstance(AssemblyName + ".UserInfoDal", true);

        //    return obj as IUserInfoDal;
        //}
    }
}
